﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EntityModel
{
  public  class HallDbContext:DbContext
    {
        public HallDbContext(DbContextOptions<HallDbContext> opts) : base(opts) { }
       
        /// <summary>
        /// 人员信息
        /// </summary>
        public DbSet<EntityUser>EntityUser { get; set; }

        /// <summary>
        /// 菜品/菜单
        /// </summary>
        public DbSet<EntityBillFare> EntityBillFare{ get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<EntityUser>().HasData(

                [
                new EntityUser(){
                    FirstName="张",
                    LastNanme="三",
                    Type=0,
                    Pay=2000,
                    Gender=true,
                    Age=20,
                    AddTime=DateTime.Now
                 },
                 new EntityUser(){
                    FirstName="李",
                    LastNanme="四",
                    Type=0,
                    Pay=2000,
                    Gender=true,
                    Age=20,
                    AddTime=DateTime.Now
                 },

                ]
                );


        }

        }
}
